using System;
using System.Collections.Generic;
using System.Text;

namespace Colman.Rpg.Messaging
{
    /// <summary>
    /// Response to a <see cref="FightResponse" />.
    /// </summary>
    [Serializable]
    public class FightResponse : ResponseMessage
    {
        /// <summary>
        /// Creates a new instance of <see cref="FightResponse" />.
        /// </summary>
        /// <param name="player">Represents the player's character.</param>
        /// <param name="playerAction">Represents the action the player has made.</param>
        /// <param name="playerActionResult">Represents the player's action result: damage for attack, hp gained for defense, unused for fleeing.</param>
        /// <param name="opponent">Represents the player's opponent.</param>
        /// <param name="opponentAction">Represents the action the opponent has made.</param>
        /// <param name="opponentActionResult">Represents the opponent's action result: damage for attack, hp gained for defense, unused for fleeing.</param>
        [System.Diagnostics.DebuggerStepThrough]
        public FightResponse(Player player, FightActionType playerAction, int playerActionResult, 
            Character opponent, FightActionType opponentAction, int opponentActionResult)
            : base(ResponseDestination.Manual)
        {
            this.player = player;
            this.playerAction = playerAction;
            this.playerActionResult = playerActionResult;
            this.opponent = opponent;
            this.opponentAction = opponentAction;
            this.opponentActionResult = opponentActionResult;

            this.DestinationUsers.Add(player);
        }

        #region Player Player { get; } (player)
        private Player player;

        /// <summary>
        /// Gets the player's character.
        /// </summary>
        public Player Player
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.player;
            }
        }
        #endregion

        #region Character Opponent { get; } (opponent)
        private Character opponent;

        /// <summary>
        /// Gets the opponent the player will fight.
        /// </summary>
        public Character Opponent
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.opponent;
            }
        }
        #endregion

        #region FightActionType PlayerAction { get; } (playerAction)
        private FightActionType playerAction;

        /// <summary>
        /// Gets the action the player has made.
        /// </summary>
        public FightActionType PlayerAction
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.playerAction;
            }
        }
        #endregion

        #region int PlayerActionResult { get; } (playerActionResult)
        private int playerActionResult;

        /// <summary>
        /// Gets the player's action result: damage for attack, hp gained for defense, unused for fleeing.
        /// </summary>
        public int PlayerActionResult
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.playerActionResult;
            }
        }
        #endregion

        #region FightActionType OpponentAction { get; } (opponentAction)
        private FightActionType opponentAction;

        /// <summary>
        /// Gets the action the opponent has made.
        /// </summary>
        public FightActionType OpponentAction
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.opponentAction;
            }
        }
        #endregion

        #region int OpponentActionResult { get; } (opponentActionResult)
        private int opponentActionResult;

        /// <summary>
        /// Gets the opponent's action result: damage for attack, hp gained for defense, unused for fleeing.
        /// </summary>
        public int OpponentActionResult
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.opponentActionResult;
            }
        }
        #endregion
    }
}
